Bug 1100945: adding a PasscodeHelper

This should do as an initial draft.
Looking forward to any kinds of feedback, especially lines 70-73 and 88-100. :)
I still think this function in return statement is too large. Could you make a named function outside, and

    .then( theFunction )

instead of create it on the fly?