Update bookshelf to latest wm and fixes for R16

Upgrade to latest webmachine and mochiweb including some compat fixes
for that upgrade.

Modifications to make bookshelf build and pass tests under Erlang R16.

Builds and passes under Erlang R15B03 so should be safe to merge any
time.