Optimize Rails-JavaScript bridge to pass less data

For JavaScript accessing the domain data I have used gon so far and I am
still intending to do that, but I must stop passing mindlessly all data
to gon.

This included a lot of statistical data from the metrics increasing the
average page size to multiple megabytes. So far this was a major reason
for slow page rendering. With this commit I am starting to refactor it
all for better overall performance.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Dynamically resolve the asset path of library.svg

I have added the svg directory to the asset pipeline. For production
this also means that I need to resolve the path of library.svg to get
the digested path, too.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Replace New Relic with rack-mini-profiler

Since rack-mini-profiler also profiles Mongoid it seems to suffice for
the biggest problems. Thus, again, I replace New Relic with it.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Add Jbuilder to tailor entity JSON

With Jbuilder I can further optimize and tailor the JSON output for
certain entities. A Jbuilder JSON template is used to declare what
fields should be used in the result. This way, for instance, I was
able to make the score just another field enabling me to remove the
calculate score function from JavaScript.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Refactor repository manager and index page

I have refactored the way the repository entities are fetched and
associated data is precompiled for the view. This allowed some minor
optimizations.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Render library.svg directly into the main layout

Instead of appending the library.svg dynamically in JavaScript when the
document has been loaded the library.svg is rendered directly after the
the body tag. This is an improvement since the charts were rendered
before the gradient and filter were available.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Add more Jbuilder JSON view templates

I have added further Jbuilder JSON view templates for continuing the
refactoring of the Rails-JavaScript gon data passing.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>
Extend snapshot JSON template for average scores

In order for the score meter to function properly again I needed to
include the average scores for each metric in the snapshot. Hence, I
have extended the Jbuilder template.

Signed-off-by: Konrad Reiche <konrad.reiche@gmail.com>