Separate Commit model and logic from Build model|etc...

This is an entirely non-user facing change which prepares GitLab CI for future support of Parallel Builds.
See https://about.gitlab.com/2013/12/19/gitlab-ci-with-parallel-builds-and-deployments/.

These changes specifically avoid changing the supported API or changing any of the website views.
Changes to the website views will come in tandem with future features like "Multiple build scripts".
The supported API won't change as part of any future changes on this vein, to maintain support for the unofficial GitLab CI runners.

This closes the following implementation step:
1. A commit has many builds

Signed-off-by: Kestred <kestred@riotcave.com>
Merge branch 'enhancement/separate-commits-from-builds' of https://gitlab.com/kestred/gitlab-ci into kestred/gitlab-ci-enhancement/separate-commits-from-builds

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	CHANGELOG
	app/models/build.rb
	app/services/create_build_service.rb
	db/schema.rb
Improve builds to commits migration using sql

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fix bugs after migration to commit->builds model

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Add commit indicies

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Improve performance

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fix lib charts

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Improve app performance

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Update db schema

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Fix syntax for pg

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Merge branch 'separate-commits-from-builds' into 'master'

Separate commits from builds

https://gitlab.com/gitlab-org/gitlab-ci/merge_requests/7 with improvements

Related to #107

See merge request !82