fix isLinkReady, clean comments
various improvements, add tests and documentation.

(cherry picked from commit 86766da0aee6e93d0b9b4bd852b33e8d3a66cf91)
fix a bug when calling theme!

(cherry picked from commit 243e9f74ca9ce157c74edd44335faa2d2572dc25)
add load test for layers

(cherry picked from commit 73ecfc37a6d2a881a2b628bd7ab7ab36fd15b176)
refactor loadDetector; switch to promises, add explicit .css extensions