Added alias functionality

- fixed previous commit where it didn't work if there was no text
selected
- implemented aliases