moving all javascript includes to footer. cleaned up some unused code