next/prev commands

Refactored next/prev commands. @lydell would you like to review before merging?
I saw people using role attribute with arbitrary values, including next/prev on the links.