Scatter plot data generation

This should actually be refactored: some methods for the creation of the
variables, then scatter plots etc in a different file.
More statistics

This code should be refactored, but for now it is capable of filling the
database with interesting information.
Fixed the issue with items in graphs

Basically: the information in the chapter and section lookup is now
correct. Items are still numbered the way they were.
Optimisations in graph statistics

I haven't hit the big optimisation yet though.
Dependencies are now written to the database