Moved the I/O loop into its own source code file, added TrySetSign method.