Added codesniffer to travisci

When code is pushed it is now failed if it fails codesniffer. Also
pushed a number of coding standards fixes so that this commit will
build correctly.