Move auto-detection up to the top and re-introduce variables.
Return to checking $PACKAGE_MANAGER.
Fixed a syntax error.
Added tests for download using wget and curl (issue #17).