added ability to read data from stdin
refactored, added ability to output json or xml
Readme updated to reflect stdin, json and xml support.