Fixed bugs with JavaScriptCanvas and added test files.