Add doc and tests to compute width and height functions.