Command system makeover, various bug fixes and improvements