Add set_calc_mode with tests and docs

Hi John,
I've implemented set_calc_mode as discussed in Issue 91. Please let me know if it needs any tweaking before you can accept it.

Cheers,
Chris