Clean up PrimAV.js -- simplify and make it validate