make reloading work right, fix event handler dupes, add exception handling