Lots of changes, mainly more tests added