added tests for compilePages method
changes to main module to make it more testable

- rejigged the frankly ridiculous method of setting options from both
  the manifest and command line - this removes the need to call
  options.set twice
- added an optional callback that gets added at the end each main
  method, which allows us to know when the process is done
added tests for main, closes #3