Fixed Nette 2.1 support and some JSON encoding bugs.