My proposal it's based on a 3.7V Li-ion Cell and a charger/monitor circuit to ensure proper usage for the Li-ion Cell.
See more details : http://www.esp8266-projects.com/2015/03/mailbag-arrival-new-battery-solution.html
Available on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/