plugins fireHook refactor

(drunk)
closes #2370
closes #2368
err check, assignPostsToCategory is sync
meh
categories.js refactor
fixed indent
fix moderators
return empty array
posts.js refactor pt1
use getPostsFields
posts/recent.js refactor
Merge branch 'master' of https://github.com/NodeBB/NodeBB
add bookshelf, and knex dependencies for mysql

Signed-off-by: Eric <ehock7229@outlook.com>