A few evil tweaks.
Added better search mechanics.
Small modification to pkg pruning, more generic.