Secondary password

Continuation of PR #52 with minor fixes and tests