Added test cases, and refactored for better testability
Corrected use of --bits option when converting waveform data files