Refactor some of the BC and source terms code into bc.c and srcterm.c