Support for wildcard elements and attributes.
Cleaning up mainprog.