Refactored worker code to remove browser dependencies.
Updated all files to support the new file structure.