Lots of cleanup

Fixed numerous printing issues, changed preface template, cleaned up
unused code