Fixed Table Bug

appendRow() return object was not the object expected.

Also, refactored code with function prototypes and section block
comments.