Basic login / authentication implementation

Handles both AppEngine-style auth and automatic auth fordevelopment environment.