Always getting BSOD

Hello, I am new to this forum and I need some help. Recently I built a desktop pc and have been getting bsod since then. Also Ive been getting so weird horizontal line flickering whenever a launch a game. I've been getting irql less than or equal, pfn list corrupt, memory management. Ive tried to exchange the ram but I still get the screen flicker(not sure of the bsod did test it for that long). Ive ran diagnostic test and my motherboard cmos battery failed. Can someone please help me!

Specs-
i7 4770k
Evga Gtx 760 Ftw 4gb
Gigabyte z87 D3hp motherboard
4x 2gb of ram from my last build
2tb western digital hardrive
windows 7 pro
Corsair Vengeance c70
 
"Ive ran diagnostic test and my motherboard cmos battery failed"... Did you fix this and set the bios to optimal settings?
 
I did not fix this. I pulled out the battery for a few minutes, put it back in, and still got the same error. I think it may be a faulty board.
 
Back