Restructured to remove forward reference warnings
Removed duplicate declaration of _buf
Increased stack size ( qyx_ suggestion was correct )
Merge pull request #1 from dbrooke/fixes

Fix memory corruption/crashing and tidy up compilation warnings