add support for arrays

added support for arrays (object[]) by detecting when an array is used as collection type and by using ArrayList for adding items to the array.
Merge pull request #5 from Towa/patch-1

add support for arrays