Q4 is for reverse polarity protection incase the battery is connected the wrong way around, Q5 is used so that if 5V from USB is connected, and the input of the inverter is grounded, then 5V is connected to the input of the LDO instead of the battery thus the battery is charged while everything runs off 5V when the USB is plugged in. If there's no 5V then the input to the inverter is pulled up, the output is a logic 0, Q5 turns on and the battery is connected to the LDO input. What do you think in terms of general layout, power pours etc? I've realised already that I could use thicker traces for power and need some stiching vias, I have kept analog and digital separate with the ADC on the boundary between the two