port libraries-over-ajax from the old easyc

pull in the old libraries-over-ajax code from the first
EasyC implementation; fix some small syntax problems; fix
a race condition at initialization (race between DOM setup
and JavaScript initialization)