More efficient _exists implementation

Closes Issue #42

This patch changes the _exists implementation to produce a more
efficient SQL query. The query goes from:

SELECT COUNT(some_field) FROM (
    SELECT <all_fields_on_model> FROM model
    WHERE expr
)

to

SELECT search_field FROM model WHERE expr LIMIT 1
Ensure nullable=False on appropriate model attributes
Add DB API for CRUD operations on repositories

Adds DB API operations on repositories, including checks for
existence and duplication of parent relations.
Merge pull request #47 from jaypipes/exists

More efficient _exists implementation
Merge pull request #49 from jaypipes/repositories

Adds DB API for repositories
Adds REST API for operations on repository

Adds the following REST API resources for managing repositories:

GET|POST /repos
GET|PUT|DELETE /repos/{repo_id}
GET|POST /domains/{domain_id}/repos
GET /{domain}/{repo_name}

The last REST API above is to enable a more GitHub-like API
retrieval of domains and repositories, including repositories
under a "personal" domain.

Completes Issue #48
Merge pull request #51 from jaypipes/repositories

Adds REST API for operations on repository