Add more/fix tests

The tests are still not finished, I'm still working on it, please don't pull this branch yet.