Now builds as a library. Other small changes.