Implements the thumbnail grid. Fixes styling in many places. Updates routing to HTML5 mode.