Added Shape locking, formatting

Shapes are now randomized on a diagram to either be Free(any random
position), Snap_Left(snap to left), Snap_Right(snap to right) or
Locked(pre-set coordinates). This was added for AGE integration.

The algorithms in general have been vastly cleaned up and properly
formatted. The setFactorWeight function also has been broken up into
three smaller functions corresponding to each factor. This was to allow
the user to not have to redefine all the factor values if they only
wanted to change one individually