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. :)
And could we merge these two promises into one? Since the first promise-then looks only do some preparation for the second one, so I think we could put these preparation code in a preparation step in the merged promise, and the following step receives them via the callback's arguments. For example:

    getFromSettings.then(() => {
        return { 'iterations': getIterations(), 'algorithm': getAlgorithm() };
    }).then((result) => {
        var {iterations, algorithm} = result;
        return theFunction(iterations, algorithm)
    }).then(....)
    .catch(....)

In this way we can reduce the nest promises, and thus reducing the complexity of the code.