Added hash as a stand-alone CLI capability.
Bug fixes and refactoring.