Add get_hash

Function for hashing keys as they enter the system.
General commit.

Imports and minor deletes.