[QuerySet] Refactor into a generic
[QuerySet] Use a managed object subclass for testing
[QuerySet] Refactor into it's own source file