Add and moving error macros to its own file.
Add Json RPC fonctionnality.