Most tests work

Most tests work, minor issues with some corner-cases. Not all objects
are Json-ified yet.