moved balde-template-gen.c to libbalde; added tests