Re-arranged some things to get ready to add main page functionality.