Finished append to a rule when cursor is in rule

Can also create new rules when cursor is out of range of a valid rule
Also sorted classes into packages