That first code, I refer you to this thread:
http://www.e90post.com/forums/showthread.php?t=1388785
All of this stuff looks like typical CBU problems. Or it could be an issue with having the battery out and replacing a ton of stuff. Try clearing the codes and driving a bit, then see if they come back.