Reorganized test cases to make more logical sense
Refactored tests for py.test