Finished JUnit tests, added some protected testing methods in classes.

JUnit tests will say "Could not listen on port 1337", but go back to the
JUnit tab, and everything passed the test, so it's ok.