Architecture refactor & maxrects packing algorithm implementation.