make lua Input/Output object types usable in other context than as globals -> prepare processing of document from a string. Remove some unnecessary forward declaration and fix warnings
resolve merge conflict