librarytree: Partialy port to prepared statement.