Added count function

The count function has an if/else statement checking if each element of the array is a string. Is this something you want? If so, what would you like the function to return if it fails? 
If you want to report an error, `throw` an `Error. Here you are returning `undefined`. You are going to crash your program with stuff like that anyway, so raise an exception.