Fix failing tests, make the onerror and onload tests more comprehensive, remove broken onload function call.
Merge pull request #320 from blakeembrey/duplicate-onload

Fix duplicate onload function calls