Export json for Clang tools.
Updated example and added callback.
Clean up tests a little and C++11 style initializers.