Initial commit, still need to remove some stuff

The code is mostly copy-pasted from Cursors, I have changed it a bit but
I still need to remove some useless bits before it even compiles.