applied several optimizations

- introduce .nothing? method to combine check for nil? or empty?
- add .chr method on String in Ruby 1.8.7 so we can use in higher versions
- use [0] instead of first to access first element of Array
- do sanity checks in more cases before running Regexp
- use truth check instead of nil? check whereever possible
- replace double quotes with %() on some interpolated strings