Added search functionality and fixed sorting by column.
Closing the login dialog now also closes the program.