hasAttribute should be case insensitive

This will fix #431 and features a test case, written by @Sebmaster