older ERTS compatibility + minor internal refactoring

external interface and behavior unchanged, except for (afaik) all statistics being keyed on atoms instead of strings