Battery configuration for 5V
Considering your battery pack (4 presumably alkaline AAs, but the converters I suggest will accommodate NiMH AAs as well) and Vcc requirements (5V at 40mA) -- you will want a SEPIC converter topology; fortunately, many boost controller and converter ICs can also implement a SEPIC.  Examples include the LM3478 and the LT1949 if you don't mind prototying with SO-8 parts -- the LM3478 is a controller that uses an external MOSFET switch (you can use most logic level N-ch FETs in your application as the switch currents are so low), while the LT1949 has a built-in power BJT switch.  If you require a through-hole package for prototyping purposes, you can use the LT1307 in an 8-pin DIP package instead, which also has a built-in power switch.

With all three of those parts, though -- your best bet is to use a simple (hand-etched or milled is fine) PCB for prototyping due to the need to keep lead and trace lengths short and loop areas small.  If that's not an option, the LT1307 should give satisfactory performance when built on a perfboard provided sufficient care is taken with component placement.

Also, I'd recommend getting a couple of chunky ferrite-core inductors (of the same value) for your prototyping -- you can always buy smaller inductors for the final PCB layout!  For instance, a pair of Bourns RLB0712s of the appropriate value should do the trick for the LT1307...you can always pick up more values if you wish, too!  (The Bourns RLB series is available in standard E12 values, and the 0712 and smaller versions are breadboard compatible...)

An example SEPIC configuration (taken straight from the datasheet) for the LM3478 is shown below -- the LTC chips I linked are broadly similar, but have the switching transistor and current sensing built-in.