Code and clean up and added class option

Cleaned up some code
Added better comments
Feature to add classes by specifying it under tag-class attribute