Make it node compatible + add some tests