Add registered events, commant execution, small fixes to various files