Fixed a couple of errors and cleaned up some code.

Fixed auto-start, refactored the build script, added mDNSResponder jar etc. See commits.