Commands overhaul

Changed how commands works and few optimizations.