Adding tests for rules
Tidying up a bit
Adding command line arguments