Faulty magnetometer HMC5883L in 9 DoF Razor IMU hardware.

I have bought a 9 DoF Razor IMU (http://www.watterott.com/en/9-DoF-Razor-IMU) sensor. But using AHRS code, magnetometer HMC5883L gives strange values. Results of 360 rotation test and values from serial port are added as attachments. It seems like random values always received. Research suggests that magnetometer (HMC5883L) could be faulty.

Or it could be other problem?

The "magn_zoomed_360_test.png" seems okay. Are those the degrees on the left axis ?
The "magn_360_test-1.png" shows peeks, the two blue peaks seem to have the same height, that is remarkable.

For the magnetometer, keep it away from electric devices. Can you try a short test for the magnetometer only and check if the I2C is okay.
Do you have a good power supply ?

This is the IMU : https://www.sparkfun.com/products/10736
I'm sorry to say, but it is only worth between 10 and 15 dollars, and the ITG-3200 is old and outdated.
The newer version of the ITG-3200 is the MPU-9250, which is a accelerometer + gyro + magnetomer in a single chip.
At Adafruit they have this: Adafruit 9-DOF Accel/Mag/Gyro+Temp Breakout Board - LSM9DS0 : ID 2021 : $24.95 : Adafruit Industries, Unique & fun DIY electronics and kits
This is the top : Adafruit 9-DOF Absolute Orientation IMU Fusion Breakout - BNO055 : ID 2472 : $34.95 : Adafruit Industries, Unique & fun DIY electronics and kits