Refactored code into persona_auth coffee-script library