Tail-Call Optimization for Dynamic Functions

 * merged code for static and dynamic function calls
 * enabled tail-call optimization for dynamic function invokations
 * optimized repeated `fn:subsequence(...)` calls
 * improved typing of type-promoted sequences