Login refactor 2

Contains the login refactor and webpack
Any reason `loadingState` should be optional?