Added more unit tests.  Simplified and cryptified api.