Token sorting

Added sorting of machine and container tokens in the machine view.
This method is now in the model, how keen are you to split this out? it seems clean to me to have it all in one method, but I'm happy to change it if it needs to happen.