Changed queryOn and andQueryOn method to build proxies from Classes instead of instances