Support for params passed as an array. Refactoring. Test fixes and additions.