Mars cleanup

WIP

Will close #160.