Adding support for arrays and refactoring a bit, to eliminate OGNL dependency.