This commit improves the initial submission by adding more tests and more configuration options. Closes gh-5158