Add R.has function and tests