Re-wrote to populate DOM and load code dynamically.