Added the function haselement (including tests) and fixed a broken nose test