Closes #34 Expanded detection and added more unit testing.