Add object annotations to JS backend

Object annotations and reflection are now available in JavaScript.
This commit also tidies up leaky variables in the other Mirror methods.