High-tech DNA testing has solved two gruesome crimes that have baffled investigators for nearly three decades — the murder and rape of two elderly Long Island psychiatric patients, prosecutors said.