4031 Use a gem to distiguish Dev and staging

https://code.google.com/p/otwarchive/issues/detail?id=4031