Be more consistent and slightly more lenient when handling GET params

Fixes an inconsistency when passed length of buffer without NUL terminating
character (ie. "this_key_is_present=&but_this_one_is_not=").

Also handles the "key" without = case by ignoring the key.

Signed-off-by: Mark Ellzey <socket@gmail.com>
Empty query args processed with a val of NULL, extended the test_query code
add connection connected status for client connection

Signed-off-by: Mark Ellzey <socket@gmail.com>
Added on_event hook / cleanup
Fixed bug with calling user-defined event callback :)

Don't do: (*cb)(stuff), do (cb)(stuff) <- mark is an idiot