Ensure objects used as maps properly check for key existence.

Objects can be dangerous to use as maps for arbitrary strings as a string might be one of the methods on Object.prototype. This is illustrated by https://github.com/Rich-Harris/esperanto/issues/21.

This mitigates the issue by calling hasOwnProperty to check existence before using a value from an Object used as a Map.

Also includes a test which fails before the diff.

Fixes support for classes to better illustrate test case.