The library portion of passwordmaker-je (from: https://code.google.com/p/passwordmaker-je/)