added support for writing to memleak caches
use memleak ndx instead of offset
removed consts.py as it was hardly used