Increase visibility for test
Extract method for testability and other renames
Added test for installation code
Added sanity checks and other refactorings to the test

Times like these I wish I had lambdas and collection operators.