Merge pull request #10 from teodozjan/master

This seems nice and simple, and may be faster than the byte-by-byte workaround.
A bit of cleanup on teodozjan++'s workaround.
Adjusting for debugging.
Merge pull request #1 from supernovus/master

Getting up to date with main upstream