Code from Login Tutorial for Sproutcore - http://broadcastingadam.com/2011/04/sproutcore_login_tutorial/