Split algorithm into separate file, add package.json