Updated to be more modular and use new 1.7.4 appengine features