Get low level IPS code and policies working

- Now with tests