TINKERPOP-1810 Support for withSack() that use Lambdas with remotes

To support this we needed to better detect the number of arguments that a lambda has so that we can properly deserialize to BinaryOperator or UnaryOperator. We also needed to better cast arguments for groovy given withSack() overlaods that aren't easily detected during eval() and generate errors otherwise. The method for detecting arguments isn't super nice - just some string parsing, but since Gremlin really only ever expects zero, one or two arg lambdas the risk of taking this approach seems low. Note that users who want to distinguish arguments must specify them with a full groovy closure syntax or else it will assume "unknown" as it always has.
11 files changed