Optimization Based Particle-Mesh Algorithm for High-Order and Conservative Scalar Transport