Make I/O more efficient.

Improve performance by buffering data and then calling
system read/write on large chunks of data.  Now runs
acceptably on beagle bone black (arm cortex-A8),
previously audio output would have large gaps and
stutters.
Minor code cleanup.
Command line config: number of samp's and downsample factor