jsoncpp integration

This pull request integrates jsoncpp, and refactors the setup files to extract common functionality into a file called setup_common.sh.