Metrics http json handler redo

@syamp

redid metrics httpjsonhandler. Allows filtering of metrics written
nit, can you break comments into 80 line width