Load attributes from class implementing method instead of file return

Instead of relying on `$attr = require $file;`, expect the `$file` to contain a class implementing certain method (static `getAttributes`) as returning from files is unsafe, confusing and causing problems if we want to implement a class in the file with utility functions and potentially do `require_once` several times on it.