Fix varargs function call with array

Call varargs function with an array as last argument act now like in Java,
so that the following code has expected behaviour :

  function varargs = |args...| {
    foreach (arg in args) {
      println(arg)
    }
  }

  function main = |args...| {
    let a = array[1, 2, 3, 4]
    varargs(a)
    # prints :
    # 1
    # 2
    # 3
    # 4
  }

Call a varags function with an empty varargs argument caused a NoSuchMethodError,
so that the following code is now correct :

  function varargs = |str,args...| {
    println(str)
    foreach (arg in args) {
      println(arg)
    }
  }

  function main = |args...| {
    varargs("foo")
    # prints :
    # foo
  }

This two changes are done for closures and constructors too.
Fix check if the variable argument is an array

the previous vesion checked if the last argument passed
is an array.
This fix check if the right argument (the last of the function type)
is an array.

  funtion foo = |args...| {
    #...
  }

  foo(array[1, 2], array[3, 4])

is equvalent to

  foo(array[array[1, 2], array[3, 4]])
Some cosmetic changes

 - Factor out type() and parameterCount(), mostly to save a few method dispatches,
in spread default augmentation

 - forgotten a space between method declaration and begin block curved brace
Fix varargs method invocation with array

Now, it works with Java Objects methods,
DynamicObjects, and Adapters.
Merge pull request #153 from Artpej/fix/varargs-function-call

Fix varargs function call with array