refactored web view and json ui handlers

organized into seperate modules.