Widget can now deal with multi-row table head (last row is used to
trigger sorting), a tbody is created, when table onyl contains a thead;
code rearranged

Change-Id: I4252312d28fdef82eba90b89c24f15ef153af353
Two minor bug fixes; two custom events added: "beforeTabClick" and
"afterTabClick"

Change-Id: I79327128755e2c93c27c6f6b812dd33e20154932