Added optional direction

* implemented direction dependent substitution and cursor calculation
* added direction constants
* defaults to forward
added default keybindings