Major bug fixes on sanitize function

Added more syntax checking for redirections
Bug fixes for top level command generation