Add missing mark cleaning and refactor mark phase
Merge remote-tracking branch 'origin/mark_and_sweep-1' into develop