Added a grid class that handles everything releated to the spatial grid.
The loading functions has also been updated.