Made login use ajax, renamed the database initialization function, added exiting on start when unable to connect to database