Move block structs and functions to block.h.

This makes it possible to use the blocks runtime from C.