Adding JSON interface and some more rdoc.