core: added an order-preserving condition to the transformation tree traversal algorithm

This should make resulting signatures more logical.
Passing kernel declaration as the first argument to kernel templates
core/transformation_modules: params -> parameters in function signatures, to unify the style with core/transformation