move integration examples to the lib
fix json in ruby < 2.0