implemented filter based on done/ongoing and due date (before/after/none). please tidy up the "rank" implementation so I can incorporate rank-based filter too.