Added documentation and some asserts (ceylon/ceylon-compiler#1764)