transferred subprograms to its own module
main file cleaned up
global input reading subroutine put back in main
solved all normal compiling errors due to separation of subroutines
changes are good after testing a run with 1 basis function. Ready for merging