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. :)
It's hard to understand code here because it's too large for a return value. Please consider move this callback out of the `return` statement. You can still benefits from closure variables if it's still in this function and above this return line.