Some tests have been improved.
The signature of some functions have been changed. Some new private functions have been created.
Json objects are now being freed.