Maintain correct class as key for regex replacements. Closes #10
Use state specific logging. Closes #9