Lots of work on the entity refactor. Looking good in test code so far :)