Add unit tests for NbtWriter