[Extensions] Add tests for exporting objects in the JavaScript shim

The test verifies if both methods of exporting objects (hanging properties
on the "export" object or return an custom object) are working fine.