Write to file if output option is provided
If cb is a string, treat it as output path
Merge pull request #17 from Techwraith/output

Output path support