Implemented piping, and data clean up functions

TODO: redirection and piping errors