A set of minor fixes / features

Some minor fixes to allow compilation under Linux (sendfile() has a different API on Linux, how lovely).

Also added two minor features that makes this a bit more useful to me: Ignore the ?... part of an URI, and look for index.html if no specific filename is given. An improvement to this would be to look for a list of filenames like index.htm and so on, and if none are found return a simple directory listing. I might add something like that if I discover that I miss it. :)