Add login panel, and clean up unused code