New core functionality

Compiles without error, but requires testing. Few things to do left,
mostly importing functionality from earlier system.