Supporting lists

Added support for writing List<String> and custom objects.