Merge pull request #3 from niksu/master

fixed join in fold code;
added mappings between types;
added naive printing function;
fixed query;
sketched more flexible query function -- compiles but doesn't work yet;