added JSDoc style documentation; re-ordered build tasks.