top: substantial changes in the interface etc.

Be careful when merging: a lot of things might have been broken.

The test suite fails now, commiting to have a checkpoint.