fixed scoping errors caused by mindless porting (let vs. var)
removed 'export.' references
added catch all error handlers => don't loose reload button on serious errors