Implementation of MojoAuth in Javascript