Add authenticate middleware in replace of security in lib
Remove lib/security.js, and begin to use source/middlewares/authenticate.js
use authenticate middleware instead of security middleware
fix bug: change util.apply to util.extend