Implemented logging in/out
Switched to Mako templates.