breaking out user constructor and db functions into modules, adding tmpl