Restructure into a package; initial integration test.
Update tree and constants.