Implemented a way to dynamically register commands and aliases

Making this a pull request so we can agree on it (or not) before merging.