Add initial category object
Tweak recycled code
Remove unused code
Fix grid logic

Changed some of the grid logic so that it relied less heavily on shaky
declarations.