Fix bug which was hiding problems in /submit/
Abstract ranking tiebreaker into database wrapper

This should have been done initially as invoking the tiebreaker
caused a runtime error up to now.