Initial commit. Working engine with a few bugs to sort out.