code cleanup and gem updates

I merged back in the layout changes, cleaned up some code and upgraded all the gems to their latest versions