Reorganized code to be more test friendly
Updated action.js to throw exceptions when the context is not right + Added unit test
Added unit tests for worker.js