Improve testing

I included and ran the istanbul tool for code coverage, these changes all come from that report