move test code to test/ subdir, add test project, add to package.json