The department of justice funding will pay for two detectives to sift through hundreds of unsolved cases that have puzzled investigators for decades. It also will pay for creating a database designed to help police pick the cases most likely to be solved.