Added an acceptrule feature, and cleaned up various things