refactor to use promises

Most classes are now promises, that resolve on close or reject on error.
Any unhandled errors are passed to the event loop for inspection.
Remove file manipulation features as they were incomplete