fix: move helper back into closure
feat: allow passing an Object instance to patch
test: add initial tests