Finished change to 'data-scriptureref' attribute instead of non-compliant 'ref'.
Various bug fixes and optimizations to regex and replacement.