Make jquery an optional dependency

I pulled in changes from the upstream outlayer which make jquery optional.