Added new register and getinstance methods
Added more function factory tests