Merged in alterego's code for on-target package installation. No UI yet.