Token sorting

Added sorting of machine and container tokens in the machine view.
It would be nice if you would split this out into a mv extension because it's quite long and a little difficult to read. Once it's split out into it's own extension these can be broken out into their own methods if needed.