moves some code from Rakefile to a helper file
remove old migration task
initial version of a query API to retrieve previous entries by report and by user