added tests, cleaned up documentation, extract/replace methods