Use rb_str_new_with_class instead of setting klass

Alternative approach to #44.

Uses the `rb_str_new_with_class` API for creating a new string of a given class instead of setting it manually (which won't work in 2.1)