James Tredwell retires from cricket