Refactor blocks, rewrite constantblock, refactor types a littl ebit