Moved some methods to private closures

For performance and compressability, i created a private closure scope
in the Collection class and moved some of the underscore methods into
private closure functions.