Fixed some duplication issues in sources files and entries.

Added duplication prevention to adding sources files, also fixed a
problem where reload() calls weren't properly clearing the loaded data.