lots of cleanups, added basic authentication, version 0.2