refactor install script

the script is now split up in parts that will be fetched from github
on demand.
fixes #4047