reworked package managemnt, added homebrew support, cleaning code