Some refactoring
A working but probably buggy engine
Adding readme and license.