add REST API for memory (heap) profiling
expose runtime memory stats
make stats interface more extendable
Merge pull request #206 from pavel-paulau/mem

Improve memory debugging facilities