change to use factory function (handles different file types)
allow non-first-row header
handle empty columns
Merge pull request #1 from lijason/master

Handle a few more cases