This will need to be rebased on master after #83 .