cosmetics
Added logging.  refactored core classes.