Extracting the main functionality out of main and into a library

With the intent that, in the future, bob can be used just as easily as a library in another project as it can as a standalone executable