Refactored creation of sublist annotations. (closes #132)

Using json_encode we solve the escape issue and have less lines. Only
difference is that the annotation variables are now object and not
arrays. But that makes no difference.