[resolves #83] Fix intermittent test failures and sort out module dependency ordering