Added user-agent detection mechanisms based on phpbrowscap.