Merge pull request #43 from greboid/master

Use DMDirc util versions of classes and have proper default settings.
Revert "Merge pull request #43 from greboid/master"

This reverts commit 6eab54b937e714cea86b6f1bec44c9ad5aa81886, reversing
changes made to 8ca19b6cfb1cbf81cd17504c7d68e070f50a1cd7.

This seems to cause a lot of NPEs on startup that I don't have time to debug right now.
Fix ServerType NPE.
Lets try this again then...

Revert "Revert "Merge pull request #43 from greboid/master""

This reverts commit e6f7b04e67484a87bb3fbdbc42a522df488de9ea.
Begin making this actually work, still needs more testing.
  - Re-add code to make sure config directory exists.
  - DefaultsConfig and ReadOnlyConfig should actually read their
    ConfigFile
  - getOption in DefaultsConfig should actually fallback rather than
    throwing an NPE when a setting does not exist.
  - Fix default value for listenhost to be one that actually works
  - AllowedChannels check needs to make sure it isn't looking for a
    null ClientID.

Extras:
  - Add missing check for "-enableDebugOptions"
  - Ignore PONG replies prior to authentication, rather than suggesting
    the user auths.
Create configs and add defaults for server.servertype, user.admin, user.first
Add some more missing defaults.
  - Re-add special handling for irc.{nickname,altnickname,realname, username}
  - AbstractListEdit command now understands the concept of "Dynamic" lists (IE, lists that don't have defaults, but are created on the fly)
Bind to ipv6 support, closes issue #41
Check that the parser that called a given callback is the parser we care about. Issue #29
Add a few more sanity checks in onDataIn parsing - Fixes issue #34
Update from master,
Fix this.
Merge pull request #49 from ShaneMcC/BetterDefaults

Merge 'BetterDefaults' branch
Update parser, finalise IPv6 binding.
Refactorage! uk.org.dataforce.dfbnc -> com.dfbnc
Move util.
Netbeans changes to make it complain less.
Don't fork when not running in a jar.
hasOption should check defaults.
Lots of Socket changes, some of which may break things!

 - When a Connected socket is closed, also include the reason in the
   Logger.info() call.

 - ConnectedSockets now handle IOExceptions when processing the selection
   key. IOExceptions are passed to a handler function in SocketWrapper
   which decides if this should be a fatal error or not (always yes right
   now.)
   - Because of this, if a non-ssl connection is made to an ssl socket,
     SecureSocket can now send them an error telling them this and close
     the socket, rather than just holding open a socket and ignoring it.
     - In future we should allow for ports that can be either SSL or not
       depending on the socket that connects.

 - As SSLByteChannel.close() gets called for cleanup when sockets close
   themselves, it will now no longer throw a ClosedChannelException if one
   occurs during the final attempt to wrap().

 - SSLByteChannel.unwrap() no longer sleeps for 100ms during every socket
   read. This was added in 2c7e76, but thss can no longer cause a 100% cpu
   loop due to changes made in 17df8555 which abort the SSLLoop after
   repeated underflows. Further changes made in this commit also break out
   of the SSLLoop early rather than repeatedly unwraping.
   - This means we no longer add an additional ~300ms of latency for no
     reason.

 - SSLByteChannel.sslLoop() will now abort the loop immediately if unwrap()
   produces an empty read outside of a handshake task (this happens if a
   non-ssl connection is made to an ssl port)

 - SSLByteChannel.sslLoop() underflow limit is now split in 2, standard
   underflow, and task-related underflow.
   - standard underflow is only increased if we are not performing a task,
     this is set to "5" as before.
   - task underflow is increased when we are performing a task.
     This is set to a really high number "5000" to allow tasks to complete,
     in a single sslLoop, but to also prevent a stray task getting carried
     away.
   This fixes the issue whereby no data was sent on the socket before the
   client sent it's first line of data, and also means we no longer need to
   sleep in unwrap()

 - SSLByteChannel.read() will now throw an SSLException if a handshake
   task is aborted due to an empty read.

 - "Socket inactivity counter threshold exceeded." error in UserSocket is
   now more verbose.

 - UserSocket now handles PING/PONGs the same way, regardless of if the
   user is connected or not.

 - Switch UserSocket to use String-Select not if/else in processLine,
   processNonAuthenticated and processAuthenticated

 - SocketWrapper now uses a ByteBuffer for the lineBuffer and only
   converts to a CharBuffer when it is time to hand off to processLine().