Handle keys with special characters [#117]

This fixes issue #117 mentioned by @alhafoudh by using `define_method` instead of an eval.