As you already have some processing power, the cheaper options actually tend to just be interfaces for the host,
texas instruments have a great bunch of options depending on how many cells your going form
As your running off of 5V, with a lower spec of 9V, it sounds like 2-3S would suit you, so that the 5V system only needs a single buck converter rather than a sepic,
you can split this problem into 2 parts, 1 is a BMS / balancing charger, the other part is a battery changeover switch, the switches are dirt cheap, the BMS for 2-3S are generally under $2 for an IC with balancing,