Add 'rm' command to console, fix purge for toplevel nodes
Refactoring, test refactoring, test lib improvements

- Improve grouping of tests
- Rewrite test to use improved test functionality
- Add Makefile for easy access
- Split into more files, factor out common things