Closes #16, closes #19: Moved functionality from lib to bin.
* Fixed check for input from stdin.
* Fixed logic around splitting files.