Addresses security problems with possible XSS scenarios and privileges.

Changes in this PR:
* XSS fix for copied posts, thanks @mdawaffe 
* JSONP callbacks sanitization, thanks @mdawaffe 
* JSON/JSONP mime types, thanks @mdawaffe 
* Post copying privileges logic reviewed and fixed to avoid post leaks
* JSON/JSONP response code refactored and fixed