Added instanbul code coverage

- Added instanbul code coverage
- Added tests to get to near 100% code coverage
- Cleaned up tests a bit
- Got rid of unsafe isArray() check