further java like formatting for php, a work in progress
a bit cleanup
started adding json rpc support for some functions.
some cleanup