first really working version: support single and repeating fields correctly, output encodings implemented, support for indicators