Improvements to HTTP/S-RPC server (RIPD-489, RIPD-533)

A large rewrite
There is less than 1% chance of the structure ever changing but a static_assert sounds good