Add tests, implement as decorator, export for commonjs