Use monotonic clock to avoid issues with clock time changes
Replace some pointers with NULL after heap freed
Use safe_shutdown vs shutdown
Add missing urldecode of JSON string values
Resolve merge conflicts