Reimplement the application logic.

New features/improvements:

- timeouts
- better (though still not great) error handling
- hooks for better app developers to make this prettier
- the ability to address EPMs on arbitrary ports (uses EpmController)
- proper threading (via EpmController)
3 files changed