First pass for cleaning loadTable code

The loading function works in 2 steps, infer the attributes of the
table to be loaded (types, sparse vs dense, header), then load it. The
advantage is that the code better organized and both the analysis and
loading steps consume much less RAM.