Issues with class metadata

Fixes issues with class metadata causing various annotations to go unprocessed (External and Value for example). Also fix for not being able to read plugin methods from javascript.

I was having an issue with multiple "metadata" elements in the class metadata being generated on my machine. This may be due to debug being enabled.