Huge commit

In short, I've started separating cli and core.