moved functions from rulecore to datacore

also set spaces relative to self in transform functions