Initial commit of API and examples

Initial commit of Bash API and example usage in shell scripts
Add exit on no connection and remove debug print

Add an exit on connection refusal at creation time
Remove some debug output
General Cleanup and bug fixes

Add sleep to poll block hits
Cleanup console and chat output
Minor bug fixes
Some restructuring of code