xmi_aux code cleanup
more code cleanup
windows specific fixes
Number of channels is now part of xmi_input

Lots of changes because of this
Merge branch 'master' into custom-detector-convolute

Conflicts:
	bin/xmimsim-gui-batch.c
	bin/xmimsim-gui-controls.c
	bin/xmimsim-gui-prefs.c
	bin/xmimsim.c
	include/xmi_data_structs.h
	src/xmi_aux_f.F90