Add core functionality

Don't expect this to work yet!...