Moved add layer functionality out into init/alloc and add calls.