Fixed minor style issues.
Moved transfer sort logic into module.
Transfer sorting now works in sync.
Removed circular reference and used an event instead.