Add /api/v1/search/courses endpoint

This involves refactoring the existing `/api/course-search` route function. I moved most of that function into `course.py`, and also made a pass at cleaning it up. Unfortunately, GitHub's diff does not display the move + edit nicely, but fortunately the commits divide up the move (ef8bb915dc1666a9c79d0bcf13761ded71de139a) and the clean-up (ed37fa8311b09b053e9fd5d211674557ed0731b9, d56a7b5f8b1fa9272e6d9633dd1b49df86746bef) to make this more easily reviewable.

Our web client is not updated to use this new API endpoint because:

- The JSON format used for the v1 API does not uglify ObjectIDs and datetimes into nested objects, which our Backbone app expects (hacky workaround: support a query param which specifies desired JSON format)
- The new API endpoint only returns data our Android app needs, which does not include professor objects or friends' avatar URLs

`http://localhost:5000/api/v1/search/courses?sort_mode=interesting&keywords=cs+security`:

```json
{
  "has_more": false, 
  "courses": [
    {
      "ratings": [
        {
          "count": 3, 
          "rating": 1.0, 
          "name": "usefulness"
        }, 
        {
          "count": 12, 
          "rating": 0.9166666666666666, 
          "name": "interest"
        }, 
        {
          "count": 5, 
          "rating": 0.2, 
          "name": "easiness"
        }
      ], 
      "user_course_id": "50adda1d286f576eeb24b0d6", 
      "code": "CS 458", 
      "name": "Computer Security and Privacy", 
      "professor_ids": [
        "ian_goldberg", 
        "douglas_stinson", 
        "urs_hengartner"
      ], 
      "prereqs": "CS350 or SE350. Computer Science students only.", 
      "overall": {
        "count": 11, 
        "rating": 0.9090909090909091
      }, 
      "id": "cs458", 
      "description": "Security and privacy issues in various aspects of computing. Specific topics include: comparing security and privacy, program security, writing secure programs, controls against program threats, operating system security, formal security models, network security, Internet application security and privacy, privacy-enhancing technologies, database security and privacy, inference, data mining, security policies, physical security, economics of security, and legal and ethical issues."
    }, 
    {
      "ratings": [
        {
          "count": 0, 
          "rating": 0.0, 
          "name": "usefulness"
        }, 
        {
          "count": 2, 
          "rating": 1.0, 
          "name": "interest"
        }, 
        {
          "count": 2, 
          "rating": 0.5, 
          "name": "easiness"
        }
      ], 
      "user_course_id": null, 
      "code": "CS 758", 
      "name": "Cryptography/Network Security", 
      "professor_ids": [
        "srinivasan_keshav", 
        "douglas_stinson"
      ], 
      "prereqs": null, 
      "overall": {
        "count": 2, 
        "rating": 1.0
      }, 
      "id": "cs758", 
      "description": "Cryptographic protocols and their application to secure communication, especially in a network setting. Identification and entity authentication; protocols for key establishment, transport, agreement and maintenance; secret sharing, broadcast encryption, tracing schemes; certificates, public-key infrastructure, PGP."
    }, 
    {
      "ratings": [
        {
          "count": 0, 
          "rating": 0.0, 
          "name": "usefulness"
        }, 
        {
          "count": 0, 
          "rating": 0.0, 
          "name": "interest"
        }, 
        {
          "count": 0, 
          "rating": 0.0, 
          "name": "easiness"
        }
      ], 
      "user_course_id": null, 
      "code": "CS 658", 
      "name": "Computer Security and Privacy", 
      "professor_ids": [], 
      "prereqs": null, 
      "overall": {
        "count": 0, 
        "rating": 0.0
      }, 
      "id": "cs658", 
      "description": "Security and privacy issues in various aspects of computing.  Specific topics include:  comparing security and privacy, program security, writing secure programs, controls against program threats, operating system security, formal security models, network security, Internet application security and privacy, privacy-enhancing technologies, database security and privacy, inference, data mining, security policies, physical security, economics of security, and legal and ethical issues. (Note: Offered F, W)"
    }, 
    {
      "ratings": [
        {
          "count": 0, 
          "rating": 0.0, 
          "name": "usefulness"
        }, 
        {
          "count": 0, 
          "rating": 0.0, 
          "name": "interest"
        }, 
        {
          "count": 0, 
          "rating": 0.0, 
          "name": "easiness"
        }
      ], 
      "user_course_id": null, 
      "code": "CS 858", 
      "name": "Advanced Topics in Cryptography, Security and Privacy", 
      "professor_ids": [], 
      "prereqs": null, 
      "overall": {
        "count": 0, 
        "rating": 0.0
      }, 
      "id": "cs858", 
      "description": ""
    }
  ], 
  "user_courses": [
    {
      "user_id": "50a532518aedf423ac645891", 
      "term_name": "Shortlist", 
      "term_id": "9999_99", 
      "has_reviewed": false, 
      "professor_id": null, 
      "course_id": "cs458", 
      "program_year_id": null, 
      "id": "50adda1d286f576eeb24b0d6", 
      "professor_review": {
        "comment": "", 
        "ratings": [
          {
            "rating": null, 
            "name": "clarity"
          }, 
          {
            "rating": null, 
            "name": "passion"
          }
        ], 
        "comment_date": null, 
        "privacy": "friends"
      }, 
      "course_review": {
        "comment": "", 
        "ratings": [
          {
            "rating": null, 
            "name": "usefulness"
          }, 
          {
            "rating": null, 
            "name": "easiness"
          }, 
          {
            "rating": 1.0, 
            "name": "interest"
          }
        ], 
        "comment_date": null, 
        "privacy": "friends"
      }
    }
  ]
}
```