revised signal detection and parsing mechanism.

simplify signal detection with state machine
commonize heart-beat and button signal parsing algorithm
compensate for bit position drifting due to indivisible samplerate vs bitrate