Address: Add a function to generate the tag and tag private key

The function in ntb_key which was used to generate the key's tag has
been moved to ntb_address so that it can also be used by the keyring.
crypto: Add an internal utility to check a signature

The code to check a signature in the function that handles a decrypted
message has been split out so that it can later also be used to check
signatures for pubkey commands.
proto: Make ntb_proto_get_pubkey keep a pointer to the signed data

The ntb_proto_pubkey struct now has a pointer to the signed data and a
length for it in order to make it easier to verify the signature.
proto: Add an option to parse the decrypted data of a v4 key

The ntb_proto_get_pubkey function now takes a boolean parameter to
specify whether the data contains the decrypted version of the v4 key
or not. The decrypted version looks exactly the same as a v3 key so
it's easier to use the same code to extract the contents.
network: Add a function to query whether the ntb_network has an object

This adds ntb_network_get_object which returns a blob given its hash
if it is in the network's hash table. Even if the object is in the
hash table the network may have moved the object out to storage
instead of keeping it in memory so there is an enum to be able to
return this case.
crypto: Add a function to decrypt a pubkey object

This adds a function called ntb_crypto_check_pubkey which decrypts a
given pubkey object and checks whether it is the key for the given
address. If so it will create an ntb_key for it and pass it to the
given callback.
keyring: Request public keys if they are not already known

Instead of dropping an outgoing message on the floor when the public
key is not immediately available it will now try to fetch the key's
object from the ntb_network. If this doesn't work it will initiate a
getpubkey request. Whenever a new pubkey object is encountered it is
checked against the pending messages to see whether this is a response
to our getpubkey request.
Actually use the version and stream passed in from the keygen IPC

The keygen IPC command has arguments to specify the version and stream
but these weren't getting passed down the ntb_crypto function. This
adds the necessary arguments to ntb_keyring_create_key and
ntb_crypto_create_key to pass them down.
proto: Fix weird comparison in get_decrypted_msg

The check for whether the remaining data has the right length was
split into a < and a > instead of a != for no particular reason.
Don't add the POW attributes when sending from a v2 address

According to the protocol, messages from a v2 key shouldn't have the
extra-bytes or nonce-trials-per-byte fields.
Add a contact address to the README
Fix returning errors from IPC requests

The res variable from ntb_ipc_client_get_response was uninitialised so
sometimes it would fail to report errors.
Add ntb_base64_encode

This adds a simple function to encode to base64
store: Use MIME's encoded words to store subject headers if need be

If the subject header contains non-ascii characters or is too long it
will now be encoded using base64 in encoded words so that it has a
better chance of being understood by the email clients.
Add a disclaimer to the README
README: Use Unicode line-drawing characters for the titles
Don't dereference an unitialised pointer in ntb_container_of

The previous implementation was dereferencing the sample pointer in
order to get the offset to subtract from the member pointer. The
resulting value is then only used to get a pointer to the member in
order to calculate the offset so it doesn't actually read from the
memory location and shouldn't cause any problems. However this is
probably technically invalid and could have undefined behaviour. It
looks like clang takes advantage of this undefined behaviour and
doesn't actually offset the pointer. It also generates a warning when
it does this.

This patch splits the ntb_container_of macro into two
implementations. Previously the macro was always used in the list
iterator macros like this:

SomeType *sample = ntb_container_of(list_node, sample, link)

Instead of doing that there is now a new macro called
ntb_list_set_iterator which explicitly assigns to the sample pointer
with an initial value before assigning to it again with the real
offset. This redundant initialisation gets optimised out by compiler.

The second macro is still called ntb_container_of but instead of
taking a sample pointer it just directly takes the type name. That way
it can use the standard offsetof macro.
base64: Add a macro to calculate the maximum input size for a buffer

Instead of hardcoding the maximum chunk size we can use for a given
buffer size, there is now a utility macro in ntb-base64.h to calculate
it.
Move the ascii_tolower utility to ntb-util.h
quoted-printable: Add an argument to specify that _ is a space

When processing the quoted printable encoding in an encoded word it
needs to interpret '_' as a space. This adds an argument to
ntb_quoted_printable_decode_start to specify that it should do this.