Added “hasClass:” method to determine if the node has a specific class

Added “hasClass:” method to determine if the node has a specific class
and edited other methods to use this method.