added support for timeup. added codecs for stdout of __name__ == "__main__"