Remove un-used var
Remove Rails dependencies on database rake tasks

Split the database.rake file in two, so we can have the rails one and
the one that doesnt require Rails to be loaded.

[fixes #3320]