PM functionality introduced, reworked command logic and much of the js logic making it more efficient