fix getLevel when level is null
add npm test and test dependencies
return null when index is not found
add tests