Added preliminary support for sparse tables.

Implementation is very naive and inefficient, but it works!