Initial grid refactor

This concentrates on moving the grid into its own module and ads a router under ```#grid``` so the code can still be called.