fix Ruby 1.8 compatibility

* no require_relative
* replace 1.9 hash syntax
* rework extraction regex due to bad non-greedy implementation