Fix status bar for mobile safari vs mobile web app

Fix status bar for mobile safari vs mobile web app, clean up code
slightly and added more comments.