Converted spans to actual labels.

Instead of the spans being used as improvised labels, actual labels are
now created. Input elements' id's are used as for attribute value when
present, otherwise a 4 character id is used. A check is implemented, to
make sure the 4 character generated id is unique within the dom.