Small bugfix & started magic rules

Small bugfixes.

Added Magic rules and magic type definitions in JSON.