Use define_method instead of eval-ing a string

It avoids the need for escaping the interpolations.
Merge pull request #98 from blom/define_method

Use define_method instead of eval-ing a string