Add Cargo support

This adds support for Cargo. This pull request is based on my other PR (#23). Only the last three commits (from July 16) are new.