Replace print statements with functions in README and docs