added apply to nsarray and nsdictionary
added tests for nsarray, nsdict apply