layout: Refactor the RenderBox type to save memory and improve the coding style of box.rs

r? @metajack