Refactored general test code to comply with DRY
Refactored the way a random string is tested
Merge pull request #7 from andyhmltn/refine-tests

Refined the way that tests work [ci skip]