more bluetooth functions

pg_template.py: added checksum support and new methods start() and end()

main_copy.cpp: added checksum operations

statechart.cpp: minor spacing edits