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. :)
Large callback inside another callback inside a return statement confused. Please consider move these two callbacks out of here. If you concern about closure variables, turn them as parameters of the functions.