Better error handling support (see PluginError enum)

Added generateError() JS exposed function to test reportErrors() (only available in DEBUG)
Updated playAtPosition() reportError call