Changed the way the cssname is set, added unittests