Code cleanup and some new vendor updates

composer.json updates for monolog and debugbar libraries - run *composer update* to get the latest

Lots of cleanup, mostly issues identified by scrutinizer-ci. Some PSR-2 cleanup on touched files.