Function that resolves a functions's arguments into a standard javascript Array, and removes any trailing undefined arguments so that the length of the array is more predictably meaningful.