fix a bug in build system where it would cause "stack level too deep" error

http://hipbyte.myjetbrains.com/youtrack/issue/RM-112

1) specify file dependencies in Rakefile with `app.files_dependencies' by user.
2) detect file dependencies by build system

When merge 1) and 2), it might cause a cyclic references.
So, we will use 1) to detect cyclic references.