Make use of libraries module; Clean up code

Makes use of the libraries module and clean up related code. Formatting changes makes it look like more is being changed than really is. I just changed a lot of tabs to 2 spaces per Drupal coding standards.