move source files to src/
fix possible stack overflow when an operation's result is immediately available