bayes working, 2 utility functions

Edited the bayes file to 1) import/ organize data; 2) fix some of the
mistakes in the jags model (syntactical); 3) add some plotting at the
end. I also added 2 utility functions: date2doy and longestRun. Neither
of these are completely necessary, but other may find them to be
convenient.