Update JS processing so inline JS comes before library code