Finished implementing #18, along with more tests and examples