Get ndb working to store locations

Lots of other little things.