cleaned up ReplaceTable and added tests
Merge pull request #58 from timbokopter/feature/cleanup_ReplaceTable

cleaned up ReplaceTable and added tests