Re-arranged source tree a bit.

I am going to bring the different implementations onto the same directory
level.
Fix memory access bug in regression test.