latest code changes really clean things up from what they were, providing a lot more organization, and implementing a really cool (imho) safe_readline() method to get data from STDIN without being DoS attack bait