Moved security properties to header, added authentication, switched to pg