Now all main core functions are implemented. Everything compiles, but I haven't tested anything. Certainly full of bugs at this stage :)