Refactored to use array margins rather than for loops, and to keep betahat data.
Changed documentation in top comment to add CRAN link for more accurate/complete/easier attribution
Added a scratch paper script and put it in the .gitignore as an easy place to prototype and to keep convenience functions for debugging, but unnecessary as an important contribution to the project work.