Test refactor and enhancement

Refactored and cleaned up tests, modified to make them more reliable when executing from within a Java environment (such as IDE). 

Also simplified some test coverage redundancy.