Add functionality needed for Google Appengine

Closes #1 and #2