First Draft of Direct WebView Communication

Via JavaScriptCore we can directly communicate with the remote library and the web library - this commit has a first draft on exactly that.
It introduces CWWebLibraryManager and CWRemoteLibraryManager that load the libraries on command, receive and delegate commands from it and can send messages to it.

There is still lots of old and unfitting code in there, though, so there is still a lot to do.
Direct WebView Communication Improvements

- Removed all (or at least most) of the old code, everything should be set up for the direct communication now
- there still seem to be some bugs in there when it comes to reconnecting devices and detecting lost/disconnected devices, investigating…
- right now there is a bug where the web libraries websocketDidOpen: arrives before the JS callback handlers are in place and the message is lost
Bugfixes

- on both the web lib and remote lib we now send a message to the view once the JS callbacks are registered, so we can be sure that websocketDidOpen doesn’t occur before we can handle it
- bugs when a remote device is lost have been fixed, this should now be properly recognized

Master-lost releated code is
 still missing
Master Shutdown

This commit adds the possibility to send the master to the background. The websocket and HTTP server will then be shut down, informing connected remotes to disconnect. Furthermore, the web library will disconnect.

Unfortunately, there is still quite a number of problems with this release:
- The master does not properly resume the webserver yet
- It seems UIWebView are bugged when it comes to websockets: sometimes when opening or closing a websocket, WebThread will crash randomly. We avoided this when shutting down the server by not closing the websockets but instead just telling connected remotes to fake-disconnect. This problem still persists when connecting to a remote, though.
Updated to latest Nodelike commit
Reverted to original send module

Wohoo, with the recent fixed in Nodelike/libuv we can use an unmodified version of the send module!
Updates to latest Nodelike commit
Reverted to original ws module

Wohoo, with the recent Nodelike fixes we can use an unmodified version of the ws module
Added Webserver Shutdown and States

- Added a serverishuttingdown message that can be sent to remotes. This will trigger remotes to get out of remote state but wait for the server to close the websocket. This prevents a bug in UIWebView that can cause a crash when the websocket is closed earlier
- Added states to RemoteLibraryManager, WebLibraryManager and WebserverManager in an attempt to reduce possible errors
- The WebserverManager now waits for the HTTP and websocket server to actually start listening before sending the webserverDidStart message to the delegate
Minor code cleanups
Fixed type in remoteconnectfailed message
Server shutdown and resume

- Implemented “soft disconnects” - when a websocket is closed while the app moves into the background this often leads to crashes due to a UIWebView bug. Because of this, when moving to the background, we “soft disconnect” all remotes - basically, everyone acts as if the websocket was disconnected but it isn’t
- When the app is sent to the background, the server now soft disconnects all remotes but keeps running and keeps the weblib connected (since it seems it cannot be shut down properly using Nodelike)
- server.js was restructured to be clearer. Some old code is still lingering in there, though

Still missing: The web library websocket might disconnect due to the network interfaces being shut down (for example when the device is sent so sleep). We need a retry mechanism
Nodelike update? Not sure why git wants it, but whatever