Marks tweaking

A number of refactored rb files. Everything tests out ok, but you should double-check before merging.