backport some casperjs utility work I did in the bsm branch
backport some casperjs utility work I did in the bsm branch

aihua/opennms,aihua/opennms,aihua/opennms,aihua/opennms,aihua/opennms,aihua/opennms,aihua/opennms,aihua/opennms,aihua/opennms