reworking some wrappers

adding some array helpers, to avoid confusion, pages are just arrays of
arrays, and we cannot use native array_filter in php 5.2 with keys