Grids: Reduce mako templating to json generation, introduce GridsView, bug fixes

iG: changed templates/webapps/galaxy/tracks/history_select_grid.mako