Added offline test mode and made localStorage key names more unique.
Refactored chart drawing code into a separate class.