Running the Coder module on uc_ajax_cart reveals thousands of violations of the Drupal Coding Standards. This patch fixes most of the 'normal' level problems reported by Coder. However, there are hundreds of 'minor' level problems remaining. Hopefully this patch takes you a long way towards making your code clean.
Note that the patch is over 1000 lines long, because almost every single line in several files needed to be changed.
Please, PLEASE familiarize yourself with the Drupal coding standards - your style is so far outside the norm for Drupal that your code is very hard to work with and understand. Even if you don't agree with some of the choices Drupal has made with these standards, they *are* the community standards, and all code in CVS is supposed to conform to these standards.