Javascript implementation of password.ly algorithm