Started BT Communication Rewrite

- Added new states to CWBluetoothConnection for each characteristic that transfers data. The old state is also kept for now, this will be rewritten further soon.
- Added the CWBluetoothTransferManager that takes care of sending/receiving messages from centrals and peripherals and also takes care of splitting those messages up in chunks of 20 bytes. The manager only reports to the delegate when a message has been fully sent or received. For now, sending data to centrals and receiving data from peripherals is possible (so basically central->peripheral communication). Peripheral->Central communication is coming.
Forgot to remove some code from CWBluetoothConnection ^^
Central -> Peripheral in TransferManager

- Last commit message falsly stated that Peripheral->Central was missing, when it was the other way around *cough*
- In any case, the TransferManager can now send and receive data in both directions
- BluetoothManager now fully uses TransferManager
- Sending IPs now writes WithoutResponse except for the last write - so we send all IPs in a “single” (chunked) message and receive a single response after the last write that tells us if any of the IPs worked
- CWBluetoothConnection no longer has a global state. Instead we use a state for every characteristic and a “didError” BOOL that indicates if this connection encountered a fatal error
We now stop testing after the first valid IP ;-)
Fix #74

- This mainly fixes issue #74 - we now make sure that a temporary scan stop can not become permanent, regardless of what happens, by simply making sure we resume after a timeout. This problem could occur, for example, when the other device’s BT crashed and we neither received a connect or connectFailed callback
- the lost connections timer is now only started when not running already, previously it was restarted in that case
- minor changes to CWBluetoothConnection states
- minor code cleanups
Code Cleanups
Remote Library Cleanup

- Moved Remote Library into different classes
- Remote Library is no concatenated and minified, just like the web library
Rewrote JS libraries

- The library sources are now stored in weblib_source and concatenated and minified into the weblib folder. Only the weblib folder is delivered with ConnichiwaResources
- Common classes are now found in the common subfolder, specific classes in the master/remote subfolders
- Most classes now use the OOP script
- Remote on the remote side has been renamed to Connichiwa. This is done so methods common to master and remote can be put in common/Connichiwa.js. This way, for a lot of things a single script can be delivered to both master and remote and works on both sides

- Added CWGestures.js and CWPinchManager.js which are responsible for detecting multi-device pinch gestures
Fixes pinches having to be on opposite edges

If devices are rotated, this is not true, for example if two device are top-to-top, having a swipe on the two top edges is also a pinch
Numerous changes

Has been a while since the last commit, numerous changes have been made:
- Major changes to the pinching code, but it is still buggy and incomplete
    - When a pinchswipe is detected in CWGestures, the x/y coordinate of the end of the swipe are now sent in the pinchswipe message
    - Pinched devices are now stored with the right/left/top/bottom neighbours and the relative x/y coordinates

- Changes to the message sending system. Both master and remotes now have a Connichiwa.send() and Connichiwa.broadcast()
    - Calling send(message) will send the message to the master device
    - Calling send(identifier, message) or .send(message) on a CWDevice will send the message to the specified device
    - Calling broadcast(message) or send(“broadcast”, message) will broadcast the message to every device except the one the send originated from
- CWGestures now correctly retrieves clientX and clientY, which is the touch/mouse position relative to the screen regardless of the shown content. Surprisingly, screenX and screenY do NOT do this.
- There is now a local CWDevice on the master that can be retrieved via CWDeviceManager’s getLocalDevice() or getDeviceWithIdentifier(“master”)
- CWDevice’s now have a method isLocal()
Pinch improvements and getDeviceTransformation()

- Pinching code has been improved
- getDeviceTransformation() now works correctly

Important: The device transformation is currently not taking DPI into account!
merged with bt send receive branch
Fixed safari websocket crash & Pinching now works

- On both master and remote side, when a message is received the parsing of the message is dispatched wie window.requestAnimationFrame(). This seems to prevent the websocket crashes on iOS (or at least make them very rare)
- Continued implementation of the pinching gesture and device transformation calculation, which at least rudimentary works now
	- right now, PPI is hardcoded for testing purposes, this needs a better solution
Improved swipe detection

- Added some additional checks for swipe length and swipe direction to filter out invalid swipes
Improved swipe detectio & scaling

- Added a check to CWGestures that prevents swipes were a user swipes in a direction, than changes the direction, than resumes the initial direction. Now only touches that swipe in a single direction for the entire duration of the touch will be recognized as a pinchswipe
- Introduces scaling to CWPinchManager. Each device now gets a scaling based on its dpi ratio to the master device, which can be used to make sure elements have the same size on all devices
	- Right now, the DPI is hardcoded, this is still “under construction”
	- There seems to be a bug with this, only one of the two axis is correctly scaled, but I am unsure why as of now
Added CWVector and PPI to inital data

- Added CWVector class that makes it easy to work with vectors in JS
- CWGestures now uses vectors

- Added CWiDevice class that contains information about the current iOS device. For now, these are mainly pixel density information
- Added PPI to the app state information
- Added PPI to the initial data
- CWPinchManager now uses the PPI sent by the devices. This is bugged right now, because the PPI for the master device are missing
The local device information are now complete

The way the native layer sends the local device information to the JS library was changed. The local device information are now identical to the initial data sent to other devices via BT. For that, the local device information dictionary is now built by the AppState and used by both CWWebLibraryManager and CWBluetoothManager. Furthermore, the way these information are received have been changed: The master web library now passes this dictionary to CWDeviceManager which creates the local device with all the information. In turn, Connichiwa’s _setIdentifier has been taken out of the master library and getIdentifier now forwards to the getIdentifier of the local device.
localidentifier message has been renamed to localinfo
Adjusted device transformation calculation for remaining edges
Made webserver file reads synchronous again

For some reason I haven’t figured out yet, file reads from the webserver are pretty slow. In particular, asynchronous file reads (via streams) is even slower than synchronous file reads. Because of that, we changed webserver file reads to being synchronous for now. Also see #78