align the boxes to the nearest plane

Align the bounding boxes to the nearest planes.
the green  cubes are the result of alignment. the red ones are the boxes w/o alignment.

![screenshot_from_2014-05-25 23 26 19](https://cloud.githubusercontent.com/assets/40454/3077181/6add9874-e418-11e3-94f9-91cdceeac1af.png)
![screenshot_from_2014-05-25 23 25 59](https://cloud.githubusercontent.com/assets/40454/3077182/6c2ad61a-e418-11e3-90ef-402a84df6009.png)