fix bugs in old node; add unit test for browsers and 'cortex test'