Refactored the interactive shell's API to its own module.