Split out unit and integration tests, refactor and removed redundant tests, improved gem executable and clean-up all round.