Heavily reconfigured to add better coloring and keymappings.