Merge pull request #731 from chrisglass/refactor-tests