Frgray dev

PEP-8 changes and utility functions split out.