Add ruby2 support and maintain ruby 1.9 compatibility