Sorry but I for one am not going to look through all that code. A) It would take me a lot of time and B) I'm just as likely to miss a simple typo (which is generally all the problem is) as you are.
What I will do is give you some debugging tips. Firstly, try rendering the shadow map texture directly to the screen (you can write a simple grey scale type fragment shader) and see what it looks like. Then try using a pre-baked shadow map to see what results you get. You can try no shadows, simple gradients, striped patterns, all sorts of things to figure out what is going on.
Basically the problem with debugging OpenGL is that the intermediate results are all inaccessible on the GPU. But this isn't the case when you are working with textures - you can jump in the middle of the process and review what is coming out and change what is going in. Make use of it.