Base: Code cleanup and additional comments

Fixed a bug on iOS where keyboard would mess up the overlay on the
login popup.