put all derivative functions in separate files

this works fine, but the Makefile is a mess, and desparately needs some love
much better than having separate branches for each polarisation
BUG: there's still a problem with selecting the right density matrix elements for each polarisation. need to think about that!