Use String#b if available

ruby 2.1 introduces Frozen String optimization and "literal".to_s.force_encoding('BINARY') will raise RuntimeError saying "can't modify frozen String".
See http://bugs.ruby-lang.org/issues/8992 .

We should use String#b introduced in ruby 2.0.0.