BlockManager: merged code from CoreManager. Compiles but segfaults. Probably broke python tests.