added getTable and getResource. Both return the parent resource for the field
db pager now sorts the result
Fixed bugs with low page display
moved variable to inside a function