Reverse package list to install required dependancies first
 Move dependancies to the end of the requirements list to handle the case where a dependancy is specified on the command line before the package that requires it.
Add some tests for issue #1934