Pulled out test code, added jquery support