Some time ago I went into Radio Shack and found a small USB rechargeable battery that has a retractable USB connector on one end and a microUSB on the other. It looks something like this but it is only 800 mah and was on sale for $8.
I wanted to use it as a power source for my RaspberryPi but wanted it to use the battery only when mains where off. I looked around for circuits that allowed for instant swithcing between 2 power sources and actually found something I could make but it was pretty complicated.