code refactoring

So many pieces of the original code were snippets from OS X
documentation or Stack Overflow solutions just to get the app running
so the project needed a major scrubbing.  This is my first pass at the
re-factoring.