Refactor WebSockets and add support of optional callback functions

Main changes:
  * Fix some bugs about UTF-8 encoding and messages fragmentation
  * Add support of optional callback functions
  * Add support of many startup options
  * Add support of outgoing fragmented messages
  * Add a websocket testsuite

                                 - * -
*** bug fixes ***

First of all, an huge part of yaws_websocket.erl was rewritten to fix bugs
about the messages fragmentation and the UTF-8 encoding of incoming text
messages:

  * UTF-8 encoding
    before, when a text message was fragmented, only the first frame was
    checked and partial UTF-8 sequences were not supported. Now, checks
    are done on each message part and a partial UTF-8 sequence at the end
    of a frame is accumulated and checked with the next frame (for basic
    callback only).

  * Messages fragmentation
    for basic callback modules, because of a buggy mapping between frames
    and messages, the messages fragmentation was almost unusable. To fix
    this, the message handling was rewritten.

Now, all tests in the autobahn testsuite[1] pass successfully.

                                 - * -
*** Optional callback functions ***

Then, from an idea of François de Metz[2], yaws_websocket module was
extended to support optional callback functions. See the documentation for
details (www/websockets.yaws).

Quickly, optional callback functions are:

  * Module:init/1           (for basic and advanced callback modules)
  * Module:terminate/2      (for basic and advanced callback modules)
  * Module:handle_open/2    (for basic and advanced callback modules)
  * Module:handle_info/2    (for basic and advanced callback modules)
  * Module:handle_message/2 (for basic callback modules only, used in place
                             of Module:handle_message/1)

Thanks to Pablo Vieytes[3] which added handle_info to optional callback
functions.
                                 - * -
*** Startup options ***

To start a websocket process a script must return the following term from
its out/1 function:

  {websocket, CallbackMod, Options}

where 'Options' is a (possibly empty) proplist. Following parameters are
supported:

  * {origin, Orig}
  * {callback, Type}
  * {keepalive, Boolean}
  * {keepalive_timeout, Tout}
  * {keepalive_grace_period, Time}
  * {drop_on_timeout, Boolean}
  * {close_timeout, Tout}
  * {close_if_unmasked, Boolean}
  * {max_frame_size, Int}
  * {max_message_size, Int}
  * {auto_fragment_message, Boolean}
  * {auto_fragment_threshold, Int}

See the documentation for details (www/websockets.yaws).

                                 - * -
*** Outgoing fragmented messages ***

A callback module can now send fragmented messages to clients using the
record #ws_frame{}:

 #ws_frame{fin     = true,  %% true | false
           rsv     = 0,
           opcode,          %% text | binary | continuation...
           payload = <<>>}. %% binary(), unmasked data

--
[1] http://autobahn.ws/testsuite
[2] https://github.com/klacke/yaws/pull/99
[3] https://github.com/pvieytes
Fix typo in documentation
spelling err
fix R16B dialyzer issue
fix deprecated make_default_sconf/0 to return sconf, not gconf
fix issue #140
fix overflowing line in yaws.tex
add yaws_api:merge_header/2 and yaws_api:merge_header/3 funs

The merge_header functions allow HTTP headers and their values to be set
and combined in a #headers{} record.
Slightly better error messages on failed startup
preparing for yaws 1.96
add documentation of exhtml directive to yaws.tex (by tjeerd)
Move WebDAV to an appmod, the locking server to a runmod (tjeerd)

All WebDAV functionality is moved to an appmod so the extension methods and
additional response headers are not part of yaws_server.erl and yaws.erl
anymore. Also the locking server is now a runmod so it is not started by
the supervisor and can be used only when needed.

Additionally the 100-Continue code is moved so it can be returned to all
requests that contain a body.

The WebDAV functionality is tested against the litmus test. All tests are
passed, except the ones that require unsupported properties. The test shows
this as a fail while returning 404 should be sufficient.
fix compiler warnings in Yaws applications
increase server stop wait time for tests

Increase the server stop wait time in test/support/include.mk.in so that
it's long enough to work with debug builds.
fix comment heads and some indentation in yaws_appmod_dav
fix dialyzer warnings
remove obsolete references to removed yaws_dav module
General whitespace and indent cleanup, removed trailing whitespace and constrained code to 80 cols
clean up & clarify code in yaws_api:setconf/3
add yaws_api:get_listen_port/1

For testing scenarios it can be useful to configure yaws to run on an
ephemeral port by setting the server port number to 0. Add the
yaws_api:get_listen_port/1 function to enable callers to retrieve the
actual port number of a server from its listen socket. The single argument
to the function is the #sconf{} record for the target server.