added logout
refined factories and services for authentication
removed unused factories