New protocol and some important fixes

- Added Old REV switches support (thanks to @easy12)
- The GC library and thread library have been slightly
changed to be thread safe again.
- In the receive thread, the sleep has been replaced by
thread safe mutexes and conditions.
- Fixed bug in node mode. Received codes from nodes
were not processed correctly.
Added HTTP 500 and some fixes in cmake file
Config wasn't freed in adhoc mode
Allow pilight-raw to be stopped
And more and more fixes
pilight version 4.0
Optimization for system id range and bugfixes
Merge remote-tracking branch 'origin/development' into development