removed some testing code :-/
changed filewriter samplerecord buffer back to 10 items from 20
dynamically allocate file handle as needed to save memory
fix auto file recovery mechanism