Revamped mcrand/. In the process of adding tests.