Detect if system is big endian (e.g. PPC64)
Cleaned up all list iterations, added macro named LIST_FOREACH.

Previously you would have to do something like this:

for (type foo = (type) list_get_first(list); foo; foo = (type) list_get_next(list)
{
    /* code */
}

Now, you can instead write this as:

LIST_FOREACH(type, foo, list,
{
    /* code */
})

Basically, boilerplate stuff including the casting is gone.
Cleaned up usage of linked lists and added missing functionality.

- Added a list_remove_first() which is generally better than list_remove()
  provided you want to remove the first element.
- Added a list_append_list() to append and move all nodes from one list to
  another.
Simple compile fix.
Removed redundant debug printf.
Clean up white space.
Updated copyright year.
Optimize lookups by CID and nick.

This used to be a linear search O(n), but is now done
as a red-black tree O(log n) instead.

These operations can be further opimized with a hash-table
which would acheive near constant time lookups.
Added mod_chat_history_sqlite and mod_chat_is_privileged.

Use file=/path/to/db to specify the database file where chat history should be stored. Other config variables are the same as those for mod_chat_history.

Code merged adapted and merged from Mimicmod's repository:
https://github.com/mimicmod/uhub.git
Remove the chat_is_privileged_plugin because it fails to compile
Fix bug #198 - Timers could cause infinite loops

This could essentially happen due to time drift,
high load, or the process being put in sleep for a while.

The reason is that recurring timers could be added to the same time slot
as the timeslot being handled.
Fix double free()
fixup! Updated copyright year.
fixup! fixup! Updated copyright year.
Merged branch janvidar/uhub