moved login script to factory, created FIREBASE_URL

moving login script to a factory service so it can be re-used, also put
firebase url into constant FIREBASE_URL