Minor refactoring.
Introducing cursors.
up and top now use cursors
Added a function 'paths' to cursors. Returns all paths from the indexed set to a cursor.