Added some basic auth features, and templated the whole thing