cleaned up exisitng code and added some documentation
cleaned up exisitng code and added some documentation

This used to be revision r1288.

biovoxxel/imagej,TehSAUCE/imagej,biovoxxel/imagej,TehSAUCE/imagej,TehSAUCE/imagej,biovoxxel/imagej