Big MC-thing refactor. Actually readable now. Partially.