Refactored some of the view code. Working on getting javascript to act right when clicking buttons