added support for findAndModify + javascript integration tests

Please ignore my previous pull request as it didn't follow the guidelines for contributing. I've signed the CLA and included tests this time.