Much of this stuff was done for RvBOMally's work by myself, but I decided to post it here for the convenience of everyone.