Abstracted out all the write parameter validation. #90

RuntimeErrors swapped out for IOError.
Pep8 work.  #90