Enable multiple registration and resolving.

Fix name issue.
Added comments.
Fix all the files.

Move files around and fix the formatting.