Harphool/sampling
This is the main development from Harphool Kumawat. The code works and it has been both verified and formatted via the standard script. A lot of work has to be done still on this code, however it would be good to integrated it in master because it is orthogonal to the other work which is going on.