JSON cleanup

* Tried to make the code more idiomatic
* Renamed the `wr` field of the `Encoder` and `PrettyEncoder` structs to `writer`
* Replaced some `from_utf8` by `from_utf8_owned` to avoid unnecessary allocations
* Removed unnecessary `unsafe` code
Removed unnecessary Box
Add `encode` and `decode` shortcut functions

Now you can just use `json::encode` and `json::decode`, which is very
practical
Implement FromStr for Json
Fix JSON documentation

Fixed some errors and added usage of the `decode` function
Fix issues in libtest
Fix issue with tests
Fix issues in librustdoc
Implement ToJson for all tuples