Export register function, and moved to own file

Change-Id: I71f0bfaf4f6edb1685eb796939bc2d891158bfef