Prune unused code and add tests to demonstrate usage