Added #include<algorithm> for Travis and added tests for has_field().