Refactored libjson co,pilation and added CMake compatibility