Separated main logic and main function.

Added `ExecuteAsCommand` function to fint.go and moved main to main.go.
Also added test program to test `ExecuteAsCommand`.