Code cleanup
Fix crash in container pagination
Potential optimizations

empty() is always O(1), size() and length() can be O(n) in some data
structures