Moved helper method from "this" to closure scope as Jasmine has a different "this" context.
Moved helper method from "this" to closure scope as Jasmine has a different "this" context.
Made URLs use relative, rather than sandbox, paths
Stubbing of application object already in use appeared to be causing errors in Jasmine, stopping re-initialisation. As it only seems to be being stubbed in order to override the device that is returned, and the device is modified through alteration of its prototype, there does not appear to be a need to stub the application for these tests - removed.