Squashed commit of the following:

commit a226efe4bb24a5e0ffe746197b4236c20589df2c
Author: Clemens Frahnow <clemens24@web.de>
Date:   Sat Jan 4 18:55:40 2014 +0100

    load tables from context

commit dbbc757fbc594f5231e0d2ba83ab133392edee80
Author: Clemens Frahnow <clemens24@web.de>
Date:   Sat Jan 4 18:45:11 2014 +0100

    fix query19