Portability/hotswap

I got myself into a bad git state by trying to reapply some changes to get https://github.com/elm-lang/elm-server/pull/16 capable of merging with debugger.

This PR has the same changes as https://github.com/elm-lang/elm-server/pull/16, but will merge.