Moved EReg stuff from wiki. TODO: cleanup, review, add doc on "map"