sage-dev: refactor UserInterface

this keeps doctesting stuff out of default UserInterface
as well as make it much more capable of implementing a gui
in the future