Add support for 4chan-compatible json API.

Conflicts:
	inc/functions.php
Make it possible to disable API, disable it by default

Conflicts:
	inc/functions.php
Custom fields in API, read config.php for info. Non-4chan compatible fields removed.
Country flags in API if they are enabled
Make file/thumb dimensons actually work (thanks sti)
;_;
Only add country to JSON if flag fits country code regex