Actual implementation of "cleanup" command

Should have added this to #9 - was a bit quick with deleting the branch :)

Refs #8