Beginnings of source code refactoring for the JSON-RPC server. Always know better ways to write things after you've been developing longer. :)