Lots of small bug fixes throughout.
more fixes to tests and ported code.
More fixes in the tests and starting to fix last remaining issues with selectors