Moved fnmatch code out of attributes_parser

Wrapped this inside attributes.c so that it's easier to replace on
Windows etc. in the future. Not the most elegant of solutions but this
means we don't have to faff around with Ragel.