Seperate declaration and assignment as CR
Remove trailing WS
Fix hardcoded argument count.. not all callbacks have 3 arguments :)
Fix argument order
Make json a optional dependency, used by default, with a fallback to PHP serialize