Add Coveralls config, code cleanup