Moved most functions over to hgrid.js, sorting not working.