Synchronise layout calls with Promises
Synchronise layout calls with Promises

Use promises to ensure that calls to layout() are carried out
in serial, so two calls can't overlap each other.

01org/nlpljs,01org/nlpljs