add device type info to middleware using the same method in context_processors
Merge pull request #7 from pylemon/master

Add device type info to middleware. Update tests. Thanks @pylemon.