TS/EG: Added length() / __len__() support

In preparation of the verbose-flag and to aid offline debugging.