first stab at a web server
fix web url parsing
serve local files
need to read all headers for connection:keep-alive to work
pulled json out of database for list and stats
Merge branch 'webjson' into webserver
effectively send json result
prepending /json to JSON calls to ease inclusion of other formats
Merge branch 'webserver'

webserver
- listens on any IPv4 and IPv6 adress
- listens on port 4646 (default)
- see config section [WebServer] to set another Port

feature #1
- URL : /json/list
- returns list of torrents known in DB

[
   {
      "hash":"26942386b3e4e69fbe8bbd462d14076d17123456",
      "name":"example_torrent-123 you like it ?"
   },
   ...
]

feature #2
- URL : /json/$H/$TS/$TE
- returns list of stats of a known torrent
- $H is a hash taken from feature #1
- $TS is start time in sec, aka unix time
- $TE is end time in sec, aka unix time
- returns only records with $TS < t < $TE
- records are sorted by increasing time

[
   {
      "d":"0",
      "t":"1386104803",
      "u":"2440873929"
   },
   ...
]

feature #3
- URL : any other
- HTTP relative path is appended to config web path
- result is opened as a file and served "as-is"
- see config section [WebServer] to set Path