Fixes to work with appengine

Uses build tags, so this should not impact current usage at all.