added warning for missing definitions;

added error for cyclic dependencies;
added tests for warnings and errors;