Lots of refactorings

This may yet turn out to have been a bad plan
Finished refactorings, updated examples
Bugfixes + SOA example
Merge pull request #1 from DaveRandom/datatype-refactoring

Datatype refactoring