src/login.c: Tidy up initialisation; seperate out different components