Refactored: Added grid_to_html method to Application class. This will later be externalised into it's own module.