move definition of lattice_grid_instance

The upgrade to Rails 3 made it necessary to move some methods
around with regard to the definition of LatticeGrid.the_instance
as the previous definition of this method was loaded after it was
needed in lib/config.rb.

This change moves the method that was previously in lib/config.rb to
config/application.rb which also requires us to call the method
‘lattice_grid_instance’ at the end of each environment definition file (for now).