MOB-116: Refactoring of worker.js and sample test complete