Implement logging in and logged in action handling.

When the application is loaded register to listen to the header element for login events.
If events are received then initialize the application.
Remove unused APPLICATION_STATUS_CHANGED constant.