Cleaned up Javascript and added underscore dependency to use underscore templates