Added metadata-printing routine.

Based on zgramana's xpath method of his c# tool.
Factorized package selection routine for printing methods.
Renamed 'arg' term as 'param', to be consistent with XML files.
Fixes: param type parsing and Metadata pretty printing.

Type parsing was being confused by generics with commas inside.
Prettier param name fixing, using indentation and method prototypes
inside comments.
arg -> param term renaming in example script.