Fixes #65. More work can be done but this is a start.