Implement background recording (in progress)

1. Bug fix -- now data is preserved successfully.
2. TBD: test different data type
Send preserved data through UART