fix some tests, change replacement handling and move old tests out of t/