Shadow user implementation

Various minor core fixes, initial implementation of shadow user