hashing and refactoring

partial password hashing, still pulling out some of the old template
stuff