Fully implemented query sub framework and tostring fun on tokens.