Stack cleanups
Remove external stack
Improve basic blocks linking implementation