Added dump(). Refactored controller
Fixed offline mode