If there is a meta file, it's sorting should be used.

Also cleaned up some js things.